<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>比赛列表</title>
</head>
<body>
<h1>比赛清单</h1>
<table border="1">
    <tr>
        <td>比赛名</td>
        <td>状态</td>
        <td>开始时间</td>
        <td>结束时间</td>
    </tr>
    <tr th:each="contest:${contests}">
        <td > <a th:if="${contest.status eq '进行中'}" target="_blank" th:text="${contest.title}" th:href="${'/contest/'+contest.contestid}"></a>
                <div th:if="${contest.status ne '进行中'}" th:text="${contest.title}"></div></td>
        <td th:text="${contest.status}"></td>
        <td th:text="${contest.starttime}"></td>
        <td th:text="${contest.endtime}" ></td>
    </tr>
</table>
<table>
    <tr>
        <td ><a th:if="${nowPage gt 0}" th:href="@{'/problem/list?page='+ ${nowPage-1} }">上一页</a></td>
        <td th:text="@{'第'+${nowPage+1}+'页'}"></td>
        <td ><a th:if="${nowPage lt totalPage-1}" th:href="@{'/problem/list?page='+ ${nowPage+1} }">下一页</a></td>
    </tr>
</table>
<a th:if="${isAdmin eq 'YES'}" href="/adminhomepage">主页</a>
<a th:if="${isAdmin eq 'NO'}" href="/userhomepage">主页</a>
</body>
</html>